package com.test.template.publish.config;

import com.baomidou.mybatisplus.annotation.TableName;
import com.test.template.publish.config.fac.VelocityTemplateConfig;
import com.test.template.tool.Tool;
import lombok.Data;

@Data
public class ControllerConfig implements VelocityTemplateConfig {
    private String tableName;
    private String domainName;
    private String packageName; // controller所在的包的名称，com.elecbook.content.api
    private String controllerName;


    // 5个请求方法
    private String save = "/op/save";

    private String get = "/op/{id}";

    private String update = "/op/update";

    private String delete = "/op/{id}";

    private String page = "/op/page";

    private String fileName = "NullController.java";

    public void innerGenerate() {
        controllerName = Tool.toUpperCase(this.tableName, 1) + "Controller";
        fileName = Tool.toUpperCase(this.tableName, 1) + "Controller.java";
    }
}
